<%@ page import="top.shiyiri.pojo.Person" %>
<%@ page import="java.util.List" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="java.util.Map" %>
<%@ page import="java.util.HashMap" %><%--
  Created by IntelliJ IDEA.
  User: 14533
  Date: 2022/1/30
  Time: 14:35
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
    <%
        Person person = new Person();
        person.setName("JavaWeb");
        person.setPhones(new String[]{"12345678", "23427392243", "234731947223"});
        List<String> cities = new ArrayList<>();
        cities.add("北京");
        cities.add("上海");
        cities.add("深圳");
        person.setCities(cities);

        Map<String, Object> map = new HashMap<>();
        map.put("key1", "value1");
        map.put("key2", "value2");
        map.put("key3", "value3");
        person.setMap(map);

        pageContext.setAttribute("person", person);
    %>

    输出 Person：${person}
    <br/>
    输出Person的name属性值：${person.name}
    <br/>
    输出Person的phones数组属性值：${person.phones[1]}
    <br/>
    输出Person的cities属性值：${person.cities[1]}
    <br/>
    输出Person的map集合：${person.map} <br/>
    输出Person的map属性值：${person.map.get("key1")}
</body>
</html>
